//
//  UIApplication+Helper.swift
//  SitPosition
//
//  Created by apple on 2019/2/12.
//  Copyright © 2019 apple. All rights reserved.
//

import Foundation
import UIKit



extension UIApplication {
    
    var topmostViewController: UIViewController? {
        guard let window: UIWindow = keyWindow else {
            return nil
        }
        return window.activeViewController?.presentedViewController ??
            window.activeViewController
    }
}


extension UIWindow {
    
    var activeViewController: UIViewController? {
        return rootViewController
    }
}


